using System;

namespace UserManagementService.Exceptions;

/// <summary>
/// 用户邮箱已存在异常
/// </summary>
public class UserEmailAlreadyExistsException : UserManagementException
{
    public string Email { get; }

    public UserEmailAlreadyExistsException(string email)
        : base($"邮箱 '{email}' 已存在")
    {
        Email = email;
    }

    public UserEmailAlreadyExistsException(string email, Exception innerException)
        : base($"邮箱 '{email}' 已存在", innerException)
    {
        Email = email;
    }
}